import config from 'config'
import httpFetch from 'share/httpFetch'

export default {
  //获取表单列表
  getCustomFormList(params){
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/branch/query`, params)
  },
  /**
   * 获取审批流版本列表
   * **/
  deleteWorkflowChain(params){
    return httpFetch.delete(`${config.baseUrl}/brms/api/rule/branch/chain/batch`, params)
  },
  /**
   * 获取审批流版本列表
   * **/
  postWorkflowVersionList(formOID, booksID){
    let params = {
      formOID,
      booksID
    };
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/branch/query/list`, params)
  },
  //查询详情
  /**
   *  version
   *  formOID
   **/
  postWorkflowDetail(params){
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/branch/query`, params)
  },
  /**
   * 保存审批流
   * **/
  postSaveNewVersion(params){
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/branch/save/version`, params)
  },
  /**
   * 保存审批流
   * **/
  postSaveVersion(params){
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/branch/save/cover`, params)
  },
  /**
   * 停用启用审批流
   **/
  postChainUsed(params){
    return httpFetch.post(`${config.baseUrl}/brms/api/rule/branch/chain/used`, params)
  },
  /**
   * 获取审批人
   **/
  getApproverType(){
    return httpFetch.get(`${config.baseUrl}/brms/api/rule/branch/approver/types`)
  },
  getNodeList(formOID){
    let params = {
      formOID
    };
    return httpFetch.get(`${config.baseUrl}/brms/api/rule/branch/node/types`, params)
  },
  postNodeCoverToShowData(params){
    return httpFetch.post('/brms/api/rule/branch/viewChain', params);
  },
  getRoleList() {
    return httpFetch.get('/api/security/permission/resource/tenant');
  },
  //批量获取人员组
  getBatchUserGroup(params) {
    return httpFetch.post(`/api/user/groups/oids`, params)
  },
  //成本中心扩展人员
  postApproverCostCenter(params){
    return httpFetch.post('/api/custom/forms/branch/approver/cost/center', params);
  }
}
